local tArgs = { ... }

if #tArgs < 1 then
 gui.printAppInfo( "security", "username not specified" )
 return
end

if not security.getSU() or tArgs[1] == "root" then
 exception.throw("RestrictedOpsException")
 return
end

local pathA = "/etc/passwd/"..tArgs[1]..".dat"
local pathB = "/etc/passwd/.shadow/"..tArgs[1]..".usr"
local pathC = "/home/"..tArgs[1]

if fs.exists(pathA) then
 if gui.request("remove user record") then
  fs.delete( pathA )
  if fs.exists(pathB) then
   fs.delete( pathB )
  end
  fs.delete( pathC )
 end
else
 gui.printAppInfo("security", "user does not exist")
end